home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 10828 / 10828.xpi / chrome / content / wunderbar-min.js < prev   
Text File  |  2009-12-13  |  40KB  |  113 lines

  1. (function(){var J=navigator.userAgent.toLowerCase();var l=/webkit/.test(J),Q=/webkit\/4/.test(J),F=!l&&/gecko/.test(J),v=!l&&/firefox\/2/.test(J),k=/msie/.test(J),E=/msie 6/.test(J),C=/msie 7/.test(J),z=0,o=0,t,f="wunderbar_load",h="wunderbar_exit",P="px",w="on",q="off",G=new Object(),g=1;var A=function(){},H=function(a){if(!l&&document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(a,null)}else{return a.currentStyle||a.style}};if(!n){var n={}}Estyle=function(i,c){i=B(i);var a=i.style[c];if(!a){if(document.defaultView){var b=document.defaultView.getComputedStyle(i,null)}a=b?b[c]:null}return a=="auto"?null:a};var B=function(a){if(typeof a=="string"){a=document.getElementById(a)}return a},y=function(e){if(!e){return[]}var a=[];for(var b=0,c=e.length;b<c;b++){a.push(e[b])}return a},p=function(a){return isNaN(parseInt(a))?0:parseInt(a)},I=function(a,b){return new RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},u=function(a,b){if(!a){return}a.className=a.className.replace(new RegExp(b,"g"),"")},r=function(c){var b=0,a=0;do{b+=c.offsetTop||0;a+=c.offsetLeft||0;c=c.offsetParent}while(c);return[a,b]},j=function(c){var b=0,a=0,i=c;do{b+=i.offsetTop||0;a+=i.offsetLeft||0}while(i=i.offsetParent);i=c;do{if(!window.opera||i.tagName=="BODY"){b-=i.scrollTop||0;a-=i.scrollLeft||0}}while(i=i.parentNode);return[a,b]};Object.extend=function(c,a){for(var b in a){c[b]=a[b]}return c};var d={create:function(){var c=null,e=y(arguments);function a(){this.initialize.apply(this,arguments)}Object.extend(a,d.Methods);a.superclass=c;a.subclasses=[];for(var b=0;b<e.length;b++){a.addMethods(e[b])}if(!a.prototype.initialize){a.prototype.initialize=function(){}}a.prototype.constructor=a;return a}};d.Methods={addMethods:function(b){var T=Object.keys(b);if(!Object.keys({toString:true}).length){T.push("toString","valueOf")}for(var a=0,c=T.length;a<c;a++){var S=T[a],e=b[S];this.prototype[S]=e}return this}};Object.extend(Object,{keys:function(c){var a=[];for(var b in c){a.push(b)}return a},clone:function(a){return Object.extend({},a)},isUndefined:function(a){return typeof a=="undefined"}});var m=function(a){return a==null?"":String(a)};Object.extend(Function.prototype,{bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var a=this,c=y(arguments),b=c.shift();return function(){return a.apply(b,c.concat(y(arguments)))}},bindAsEventListener:function(){var a=this,c=y(arguments),b=c.shift();return function(e){return a.apply(b,[e||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=y(arguments);return function(){return a.apply(this,b.concat(y(arguments)))}},
  2.  
  3. delay:function(){var a=this,b=y(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)}});Function.prototype.defer=Function.prototype.delay.curry(1);Object.extend(G,{element:function(a){return B(a.target||a.srcElement)},stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},observers:false,_observeAndCache:function(c,i,b,a){if(!this.observers){this.observers=[]}if(c.addEventListener){this.observers.push([c,i,b,a]);c.addEventListener(i,b,a)}else{if(c.attachEvent){this.observers.push([c,i,b,a]);c.attachEvent("on"+i,b)}}},unloadCache:function(){if(!G.observers){return}for(var a=0,b=G.observers.length;a<b;a++){G.stopObserving.apply(this,G.observers[a]);G.observers[a][0]=null}G.observers=false},observe:function(c,i,b,a){c=B(c);a=a||false;if(i=="keypress"&&(l||c.attachEvent)){i="keydown"}G._observeAndCache(c,i,b,a)},stopObserving:function(i,S,b,a){i=B(i);a=a||false;if(S=="keypress"&&(l||i.attachEvent)){S="keydown"}if(i.removeEventListener){i.removeEventListener(S,b,a)}else{if(i.detachEvent){try{i.detachEvent("on"+S,b)}catch(c){}}}}});if(k){G.observe(window,"unload",G.unloadCache,false)}var K={these:function(){var c;for(var b=0,S=arguments.length;b<S;b++){var a=arguments[b];try{c=a();break}catch(T){}}return c}};var x={getTransport:function(){return K.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false}};x.Updater=d.create({_complete:false,initialize:function(b,a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJS:true};Object.extend(this.options,a||{});this.transport=x.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var i=Object.clone(this.options.parameters);this.parameters=i;try{var a=new x.Response(this);if(this.options.onfreate){this.options.onCreate(a)}this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||i):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){a["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){a.Connection="close"}}for(var b in a){this.transport.setRequestHeader(b,a[b])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=x.Updater.Events[a],b=new x.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||A)(b)}catch(i){this.dispatchException(i)}}try{(this.options["on"+c]||A)(b)}catch(i){this.dispatchException(i)}if(c=="Complete"){this.transport.onreadystatechange=A}},dispatchException:function(a){}});x.Updater.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];x.Response=d.create({initialize:function(b){this.request=b;var c=this.transport=b.transport,a=this.readyState=c.readyState;if((a>2&&!k)||a==4){this.status=this.getStatus();this.responseText=m(c.responseText)}},status:0,getStatus:x.Updater.prototype.getStatus});var D={h:function(e){var b=0;for(L=0;L<e.length;L++){b+=e.charCodeAt(L)}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var a=c.substr(b&63,1);while(b>63){b>>=6;a=c.substr(b&63,1)+a}return a},y:function(a){return a.owner&&a.key&&!a.key.indexOf(D.h(a.owner))},b:function(a){return a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))},focus:function(b){b.focus();var a=b.value.length;if(k){var c=b.createTextRange();c.moveStart("character",a);c.moveEnd("character",a);c.select()}else{b.setSelectionRange(a,a)}}};var s=function(){this.initialize.apply(this,arguments)};(function(){var b;function a(){if(z){return}if(b){window.clearInterval(b)}z=1}if(document.addEventListener){if(l){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);G.observe(window,"load",a)}else{document.addEventListener("DOMContentLoaded",a,false)}}else{document.write("<script id=_onDOMContentLoaded defer src=//:><\/script>");B("_onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}})();Object.extend=function(c,a){for(var b in a){c[b]=a[b]}return c};Function.prototype.bind=function(){var a=this,c=y(arguments),b=c.shift();return function(){return a.apply(b,c.concat(y(arguments)))}};Function.prototype.bindAsEventListener=function(c){var a=this,b=y(arguments),c=b.shift();return function(e){return a.apply(c,[e||window.event].concat(b))}};Object.extend(s,{u:function(a){while(a=a.parentNode){if(a.style){if(a.style.overflow=="hidden"){a.style.overflow="visible"}if(a.style.tableLayout=="fixed"){a.style.tableLayout="auto"}}}},removeWatermark:function(b,a){s.owner=b+" Autocomplete";s.key=a},findPopup:function(a){var b=G.element(a);b=b?b:a;while(b&&b.parentNode&&!I(b,"autocomplete_list")){b=b.parentNode}if(b==null){return null}return b.parentNode&&b.id?b:null},I:function(b){var a;if(b.nodeType==1){a=b.getAttribute("onselect")}return(a!=null)&&(a!=undefined)},F:function(a,c){var b=G.element(a);while(b.parentNode&&(b!=c)&&(!s.I(b))){b=b.parentNode}return(b.parentNode&&(b!=c))?b:null},C:function(c){var T=G.element(c);for(var S=0;S<s.inst.length;S++){var b=s.inst[S];if(b.text!=T&&b.L.L2!=T){setTimeout(b.hide.bind(b),0)}}},L:function(){if(k){t=self.name}var a="autocomplete_x1";if(z){var c=document.createElement("div");c.id=a;document.body.appendChild(c)}else{document.write("<div id='"+a+"'></div>")}var c=B(a);var T=c.style;T.position="absolute";T.left=T.top="-800px";T.overflow="scroll";T.width="40px";c.className=f;c.innerHTML="<div style='width:80px' class='"+h+"'></div>";o=c.offsetWidth-c.clientWidth;for(var b=0;b<s.inst.length;b++){var S=s.inst[b];S.pi.bind(S)}},inst:new Array(),name:"",key:""});s.prototype={$c:0,init:0,T:0,i:-1,d:1,last_value:"",custom_uri:"",initialize:function(W,i,X){this.text=B(W)?B(W):document.getElementsByName(W)[0];if((this.text==null)||(i==null)||(typeof i!="function")){return}this.text.setAttribute("autocomplete",q);this.setOptions(X);this.f=i;this.makeURI=function(){if(this.bR()){return this.f()}}.bind(this);var U=this.text.getAttribute("autocomplete_id");if(U!=null){return}var b="no_"+s.inst.length;this.text.setAttribute("autocomplete_id",b);this.onchange=this.text.onchange;this.text.onchange=function(){};var c=function(ab){var Y="autocomplete_list";if(z){var Z=document.createElement("ol");Z.id=ab+"_"+Y;var aa=Z.style;aa.position="absolute";aa.left=aa.top="-9999px";Z.className=Y;document.body.appendChild(Z)}else{document.write("<ol id='"+ab+"_"+Y+"' style='position:absolute;left:-9999;top:-9999px' class='"+Y+"'></ol>")}var Z=B(ab+"_"+Y);return Z};this.L=c(b+"a");this.L2=c(b+"b");if(E){if(z){var S=document.createElement("iframe");S.id=b+"_iframe";var V=S.style;V.position="absolute";V.filter="progid:DXImageTransform.Microsoft.Alpha(opacity = 0)";S.src="javascript:false;";document.body.appendChild(S)}else{document.write("<iframe id='"+b+"_iframe' style='position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity = 0)' src='javascript:false;'></iframe>")}this.F=B(b+"_iframe");this.F.style.display="none"}s.inst.push(this);if(s.L){s.L();s.L=null}var a="autocomplete_"+new Date().getTime();document.write("<div id='"+a+"' class='wunderbar_search' style='position:absolute;width:11px;height:11px;left:-99px;top:-99px"+top+"'></div>");var T=B(a);T.onclick=function(){if(this.icon.className==h){this.notBusy();this.makeURI()}this.text.focus()}.bind(this);this.icon=T;this.fpi();G.observe(window,"resize",this.pi.bind(this));this.r()},fpi:function(){for(var a=1;a<=4*20;a++){setTimeout(this.pi.bind(this),a*50)}},pi:function(){var a=j(this.text);this.icon.style.left=(a[0]+this.text.offsetWidth-18)+"px";this.icon.style.top=(a[1]+(this.text.offsetHeight-11)/2-(E?2:0)+(C?1:0))+"px"},V:function(){var a=this.L.style;return(a.display!="none")&&(p(a.left)>=0)&&(p(a.top)>=0)},setOptions:function(a){this.options={width:"auto",delay:0.02,minChars:1,delimChars:",",size:10,select_first:1,align:"auto"};Object.extend(this.options,a||{})},r:function(){this._k=this.k.bindAsEventListener(this);this.$r=this.request.bind(this);var a=this.text;a.className+=" autocomplete_text";if(/mac/.test(J)){a._ac=this;a.onkeypress=function(i){return !this._ac.$s}}var c=G.observe;if(k){c(a,"keydown",this._k)}else{c(a,"keypress",this._k)}c(a,"keyup",function(){clearTimeout(this.$u)}.bind(this));c(a,"blur",this.blur.bind(this));if(s.inst.length==1){c(document,"click",s.C)}var b=a;while(b=b.parentNode){if(b.style&&(b.style.overflow=="scroll"||b.style.overflow=="auto")){this.scrollable=this.scrollable?this.scrollable:b;c(b,"scroll",this.onScroll.bind(this))}}},onScroll:function(){var a=this.scrollable;if(a){var b=this.t();var c=r(a);if(b[1]>=c[1]&&b[1]<c[1]+a.offsetHeight&&b[0]>=c[0]&&b[0]<c[0]+a.offsetWidth&&this.V()){this.s()}else{this.hide()}}},t:function(){var a=j(this.text);return[a[0]+(k?this.text.scrollLeft:0)+(document.documentElement.scrollLeft||document.body.scrollLeft),a[1]+(document.documentElement.scrollTop||document.body.scrollTop)]},iolv:function(){var S=this.options.delimChars,b=encodeURIComponent(this.text.value),e,c,a=0;for(e=b.length-1;e>=0;e--){for(c=0;c<S.length;c++){if(b.charAt(e)==S.charAt(c)){a=e+1;break}}if(a){break}}return a},page:function(e){var c=this.options.size,b=this.i,a=this.items.length;if(e=="page_up"){if(b>=c){this.focus(b-c)}else{this.focus(0)}}if(e=="page_down"){if(b+c<a){this.focus(b+c)}else{this.focus(a-1)}}},blur:function(){if(!this.V()&&this.icon.className!=f){this.status=q;setTimeout(function(){if(this.status==q){this.stop()}}.bind(this),4)}},stop:function(){this.c();this.notBusy();this.hide()},c:function(){if((this.latest)&&(this.latest.transport.readyState!=4)){this.latest.transport.abort()}},k:function(b){this.status=w;this.$s=false;var i=b.keyCode;var a=this.options.delay;this.isModified=true;if(i==13||i==9){if(i==13){G.stop(b)}if(this.V()||i==9){if((this.$c)&&(this.i>-1)){this.$s=true}this.z();return}a=0.01;this.isModified=false}if(i==38||i==40||i==63232||i==63233){if(this.$c){(i==38)||(i==63232)?this.U():this.D();G.stop(b)}}if(i==33||i==34||i==63276||i==63277){if(this.$c){(i==33)||(i==63276)?this.page("page_up"):this.page("page_down")}}if(i==27){this.stop();if(l){this.text.blur();this.text.focus()}}if(i==38||i==40||i==33||i==34||i==27||i==63232||i==63233||i==63276||i==63277){G.stop(b);return}switch(i){case 9:case 37:case 39:case 35:case 36:case 45:case 16:case 17:case 18:break;default:this.custom_uri="";clearTimeout(this.T);this.c();setTimeout(function(){this.T=setTimeout(this.$r,a*1000)}.bind(this,a),4)}},z:function(){var a=this.G();this.stop();if((a==undefined)||(a==null)){return}if(a){try{nav(a.getAttribute("onselect"))}catch(b){}if(!D.y(s)){setTimeout(this.icon.onclick,256*4)}D.focus(this.text);if(this.onchange){setTimeout(function(){this.onchange.bind(this.text)()}.bind(this),4)}}},G:function(){return this.items?this.items[this.i]:null},focus:function(S,X){if((this.i==S)||(!this.$c)){return}this.L.style.display="";u(this.G(),"current_item");this.i=S;var c=this.G();if(!c){return}c.className+=" current_item";if(S==0){c.className+=" first_item_no_border"}var Y=this.L,T=this.options.size*c.offsetHeight,a=c.offsetTop;if(v){a+=g}if(k&&(document.documentMode!=8)){a-=p(H(c).paddingTop)}var U=(a<Y.scrollTop)||(S==0);var b=a+c.offsetHeight-Y.scrollTop>T;if(U||b){u(this.first,"first_item");u(this.first,"first_item_no_border")}if(U){Y.scrollTop=a;c.className+=" first_item_no_border";this.first=c}if(b){Y.scrollTop=a+c.offsetHeight-T;this.first=this.items[S+1-this.options.size];if(this.first){this.first.className+=" first_item"}}try{var W=c.getAttribute("onfocus");if(k){W=D.b(W.toString())}}catch(V){}},U:function(){if(this.i>-1){this.focus(this.i-1)}},D:function(){if(this.i<this.items.length-1){this.focus(this.i+1)}},bR:function(){if(!this.init){this.init=true;this.L.onscroll=function(){D.focus(this.text)}.bind(this)}this.last_value=this.value.substr(this.iolv());var a=this.last_value?this.last_value.length:this.text.value.length;return a>=this.options.minChars},request:function(a){var b=typeof a!="string";this.value=encodeURIComponent(this.text.value);if(a==1){a=this.url;this.status=w}else{if(b){a=this.makeURI()}}if(this.status==w){this.onLoad();this.url=a;if(a==undefined){this.stop();return}this.latest=new x.Updater(a+this.custom_uri,{method:"get",
  4.  
  5. onComplete:this.d.bind(this)})}else{this.stop()}},
  6.  
  7. onLoad:function(){this.$c=0;this.i=-1;this.busy()},
  8.  
  9. d:function(T){
  10.     var S=this.latest;
  11.     var c=S.transport;
  12.     if((this.status==w)){alert("sdds");
  13.     this.L2.innerHTML='';// GRI2 + GRI;
  14.     this.$c=true;
  15.     if(!S.success){S.success=S.responseIsSuccess}
  16.     try{
  17.         if((typeof c.status!="unknown")&&S.success()){}
  18.         else{
  19.             this.L2.innerHTML="<li onselect=';'>Please try again.<br/>HTTP error code:"+c.status+"</li>"
  20.         }
  21.         this.L2.style.width=this.L2.style.height="auto";
  22.         var b=this.L2.childNodes;
  23.         var V=0;
  24.  
  25.         for(var U=0;U<b.length;U++){
  26.             var a=b[U];
  27.             if(s.I(a)){
  28.                 a.className="item";
  29.                 if(k&&(++V<=this.options.size)&&!a.getElementsByTagName("span").length){
  30.                     a.innerHTML="<span style='padding:0'></span>"+a.innerHTML
  31.                 }
  32.             }
  33.         }
  34.         this.$c=true;
  35.         if(b.length>0){
  36.             //this.s(this.options.select_first)
  37.         }    else    {
  38.             this.stop()
  39.         }
  40.     }
  41.         catch(W){}
  42.     }
  43. },
  44.  
  45. offset:function(c){var i=0;if(F||l||(k&&(document.compatMode!="BackCompat"))){var a="padding-left",S="padding-right";var b=function(U,T){return p(Estyle(U,T))};i=g*2+b(c,a)+b(c,S)}return i},H:function(c){var S=this.options.size;var b=y(c.getElementsByTagName("li"));var e=b.length;var a=b[(e>S?S:e)-1];var i=a.offsetTop+a.offsetHeight;if(k){if(document.compatMode=="BackCompat"){i+=g*2}i+=g;if(document.documentMode!=8){i-=p(H(a).paddingTop)}i-=g*2}if(Q){i-=g}return i-g},s:function(X){this.status=w;var b=this.t();var c=this.text.offsetHeight;if(this.status==w){var ae=b[1]+c;if(this.status!=w){return}var ab="auto";var V=600;if(!!window.opera){this.L2.style.width=V+P}var ad=this.L2.offsetHeight;if(l||F){ab=this.L2.offsetWidth}else{var S=this.text.offsetWidth,W=V,e;do{V=Math.ceil((S+W)/2);this.L2.style.width=V+P;e=this.L2.offsetWidth;if((F)||(document.compatMode=="CSS1Compat")){e-=g*2}if((this.L2.offsetHeight>ad)||(e>V)){S=V+1}else{W=V}}while(W-S>=20);ab=W;this.L2.style.width=ab+P}if(this.L2.offsetWidth<this.text.offsetWidth){ab=this.text.offsetWidth-this.offset(this.L2)}var W="auto";this.items=new Array();if(this.L.innerHTML!=this.L2.innerHTML){this.L.innerHTML=this.L2.innerHTML;this.i=-1;var U=this.L.childNodes;for(var T=0;T<U.length;T++){var aa=U[T];if(aa.className=="item"){var V=this.items.length;aa.onmouseover=function(a){this.focus(a)}.bind(this,V);aa.onclick=function(a){this.i=a;this.z()}.bind(this,V);this.items.push(aa)}}}if(this.items.length>this.options.size){this.L.style.overflow="auto";ab=parseInt(ab)+o;W=this.H(this.L2)+P}if(this.items.length){var S=b[0],Y=this.text.offsetWidth-ab,Z=this.options.align,U=this.L.style;if((Z=="auto")&&(document.body.offsetWidth-S-ab>14)){Y=0}if(Z=="left"){Y=0}if(Z=="center"){Y/=2}U.top=ae+P;U.left=S+Y+P;U.width=ab+P;U.height=W;U.display="";if(X){setTimeout(this.D.bind(this),0)}if(this.F){self.name=t;var ac=this.F.style;ac.top=ae+P;ac.left=b[0]+P;ac.width=ab;ac.height=this.L.clientHeight;ac.display=""}}this.notBusy();if(k){setTimeout(function(){for(var i=0;i<this.items.length;i++){var a=this.items[i];if(!a.getElementsByTagName("span").length){a.innerHTML="<span style='padding:0'></span>"+a.innerHTML}}}.bind(this),0)}}},hide:function(){if(this.V()){this.L.style.display="none";if(this.F){this.F.style.display="none"}}},busy:function(){this.icon.className=f},notBusy:function(){this.icon.className="wunderbar_"+(this.text.value.length==0?"icon":"exit")}};window.AutoComplete=window.Wunderbar=s;try{var R="a.js",O="a.l",N=document.getElementsByTagName("script"),L;for(L=0;L<N.length;L++){if(N[L].src.indexOf(R)>-1){document.write(unescape("%3Cscript src='"+N[L].src.replace(R,O)+"' type='text/javascript'%3E%3C/script%3E"))}}}catch(M){}})();(function(){var J=navigator.userAgent.toLowerCase();var l=/webkit/.test(J),Q=/webkit\/4/.test(J),F=!l&&/gecko/.test(J),v=!l&&/firefox\/2/.test(J),k=/msie/.test(J),E=/msie 6/.test(J),C=/msie 7/.test(J),z=0,o=0,t,f="wunderbar_load",h="wunderbar_exit",P="px",w="on",q="off",G=new Object(),g=1;var A=function(){},H=function(a){if(!l&&document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(a,null)}else{return a.currentStyle||a.style}};if(!n){var n={}}Estyle=function(i,c){i=B(i);var a=i.style[c];if(!a){if(document.defaultView){var b=document.defaultView.getComputedStyle(i,null)}a=b?b[c]:null}return a=="auto"?null:a};var B=function(a){if(typeof a=="string"){a=document.getElementById(a)}return a},y=function(e){if(!e){return[]}var a=[];for(var b=0,c=e.length;b<c;b++){a.push(e[b])}return a},p=function(a){return isNaN(parseInt(a))?0:parseInt(a)},I=function(a,b){return new RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},u=function(a,b){if(!a){return}a.className=a.className.replace(new RegExp(b,"g"),"")},r=function(c){var b=0,a=0;do{b+=c.offsetTop||0;a+=c.offsetLeft||0;c=c.offsetParent}while(c);return[a,b]},j=function(c){var b=0,a=0,i=c;do{b+=i.offsetTop||0;a+=i.offsetLeft||0}while(i=i.offsetParent);i=c;do{if(!window.opera||i.tagName=="BODY"){b-=i.scrollTop||0;a-=i.scrollLeft||0}}while(i=i.parentNode);return[a,b]};Object.extend=function(c,a){for(var b in a){c[b]=a[b]}return c};var d={create:function(){var c=null,e=y(arguments);function a(){this.initialize.apply(this,arguments)}Object.extend(a,d.Methods);a.superclass=c;a.subclasses=[];for(var b=0;b<e.length;b++){a.addMethods(e[b])}if(!a.prototype.initialize){a.prototype.initialize=function(){}}a.prototype.constructor=a;return a}};d.Methods={addMethods:function(b){var T=Object.keys(b);if(!Object.keys({toString:true}).length){T.push("toString","valueOf")}for(var a=0,c=T.length;a<c;a++){var S=T[a],e=b[S];this.prototype[S]=e}return this}};Object.extend(Object,{keys:function(c){var a=[];for(var b in c){a.push(b)}return a},clone:function(a){return Object.extend({},a)},isUndefined:function(a){return typeof a=="undefined"}});var m=function(a){return a==null?"":String(a)};Object.extend(Function.prototype,{bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var a=this,c=y(arguments),b=c.shift();return function(){return a.apply(b,c.concat(y(arguments)))}},bindAsEventListener:function(){var a=this,c=y(arguments),b=c.shift();return function(e){return a.apply(b,[e||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=y(arguments);return function(){return a.apply(this,b.concat(y(arguments)))}},
  46.  
  47. delay:function(){return;/*ADAR*/var a=this,b=y(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)}});Function.prototype.defer=Function.prototype.delay.curry(1);Object.extend(G,{element:function(a){return B(a.target||a.srcElement)},
  48.  
  49. stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},observers:false,_observeAndCache:function(c,i,b,a){if(!this.observers){this.observers=[]}if(c.addEventListener){this.observers.push([c,i,b,a]);c.addEventListener(i,b,a)}else{if(c.attachEvent){this.observers.push([c,i,b,a]);c.attachEvent("on"+i,b)}}},unloadCache:function(){if(!G.observers){return}for(var a=0,b=G.observers.length;a<b;a++){G.stopObserving.apply(this,G.observers[a]);G.observers[a][0]=null}G.observers=false},observe:function(c,i,b,a){c=B(c);a=a||false;if(i=="keypress"&&(l||c.attachEvent)){i="keydown"}G._observeAndCache(c,i,b,a)},stopObserving:function(i,S,b,a){i=B(i);a=a||false;if(S=="keypress"&&(l||i.attachEvent)){S="keydown"}if(i.removeEventListener){i.removeEventListener(S,b,a)}else{if(i.detachEvent){try{i.detachEvent("on"+S,b)}catch(c){}}}}});if(k){G.observe(window,"unload",G.unloadCache,false)}var K={these:function(){var c;for(var b=0,S=arguments.length;b<S;b++){var a=arguments[b];try{c=a();break}catch(T){}}return c}};var x={getTransport:function(){return K.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false}};x.Updater=d.create({_complete:false,initialize:function(b,a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJS:true};Object.extend(this.options,a||{});this.transport=x.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var i=Object.clone(this.options.parameters);this.parameters=i;try{var a=new x.Response(this);if(this.options.onfreate){this.options.onCreate(a)}this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||i):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){a["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){a.Connection="close"}}for(var b in a){this.transport.setRequestHeader(b,a[b])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=x.Updater.Events[a],b=new x.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||A)(b)}catch(i){this.dispatchException(i)}}try{(this.options["on"+c]||A)(b)}catch(i){this.dispatchException(i)}if(c=="Complete"){this.transport.onreadystatechange=A}},dispatchException:function(a){}});x.Updater.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];x.Response=d.create({initialize:function(b){this.request=b;var c=this.transport=b.transport,a=this.readyState=c.readyState;if((a>2&&!k)||a==4){this.status=this.getStatus();this.responseText=m(c.responseText)}},status:0,getStatus:x.Updater.prototype.getStatus});var D={h:function(e){var b=0;for(L=0;L<e.length;L++){b+=e.charCodeAt(L)}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var a=c.substr(b&63,1);while(b>63){b>>=6;a=c.substr(b&63,1)+a}return a},y:function(a){return a.owner&&a.key&&!a.key.indexOf(D.h(a.owner))},b:function(a){return a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))},focus:function(b){b.focus();var a=b.value.length;if(k){var c=b.createTextRange();c.moveStart("character",a);c.moveEnd("character",a);c.select()}else{b.setSelectionRange(a,a)}}};var s=function(){this.initialize.apply(this,arguments)};(function(){var b;function a(){if(z){return}if(b){window.clearInterval(b)}z=1}if(document.addEventListener){if(l){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);G.observe(window,"load",a)}else{document.addEventListener("DOMContentLoaded",a,false)}}else{document.write("<script id=_onDOMContentLoaded defer src=//:><\/script>");B("_onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}})();Object.extend=function(c,a){for(var b in a){c[b]=a[b]}return c};Function.prototype.bind=function(){var a=this,c=y(arguments),b=c.shift();return function(){return a.apply(b,c.concat(y(arguments)))}};Function.prototype.bindAsEventListener=function(c){var a=this,b=y(arguments),c=b.shift();return function(e){return a.apply(c,[e||window.event].concat(b))}};Object.extend(s,{u:function(a){while(a=a.parentNode){if(a.style){if(a.style.overflow=="hidden"){a.style.overflow="visible"}if(a.style.tableLayout=="fixed"){a.style.tableLayout="auto"}}}},removeWatermark:function(b,a){s.owner=b+" Autocomplete";s.key=a},findPopup:function(a){var b=G.element(a);b=b?b:a;while(b&&b.parentNode&&!I(b,"autocomplete_list")){b=b.parentNode}if(b==null){return null}return b.parentNode&&b.id?b:null},I:function(b){var a;if(b.nodeType==1){a=b.getAttribute("onselect")}return(a!=null)&&(a!=undefined)},F:function(a,c){var b=G.element(a);while(b.parentNode&&(b!=c)&&(!s.I(b))){b=b.parentNode}return(b.parentNode&&(b!=c))?b:null},C:function(c){var T=G.element(c);for(var S=0;S<s.inst.length;S++){var b=s.inst[S];if(b.text!=T&&b.L.L2!=T){setTimeout(b.hide.bind(b),0)}}},L:function(){if(k){t=self.name}var a="autocomplete_x1";if(z){var c=document.createElement("div");c.id=a;document.body.appendChild(c)}else{document.write("<div id='"+a+"'></div>")}var c=B(a);var T=c.style;T.position="absolute";T.left=T.top="-800px";T.overflow="scroll";T.width="40px";c.className=f;c.innerHTML="<div style='width:80px' class='"+h+"'></div>";o=c.offsetWidth-c.clientWidth;for(var b=0;b<s.inst.length;b++){var S=s.inst[b];S.pi.bind(S)}},inst:new Array(),name:"",key:""});s.prototype={$c:0,init:0,T:0,i:-1,d:1,last_value:"",custom_uri:"",initialize:function(W,i,X){this.text=B(W)?B(W):document.getElementsByName(W)[0];if((this.text==null)||(i==null)||(typeof i!="function")){return}this.text.setAttribute("autocomplete",q);this.setOptions(X);this.f=i;this.makeURI=function(){if(this.bR()){return this.f()}}.bind(this);var U=this.text.getAttribute("autocomplete_id");if(U!=null){return}var b="no_"+s.inst.length;this.text.setAttribute("autocomplete_id",b);this.onchange=this.text.onchange;this.text.onchange=function(){};var c=function(ab){var Y="autocomplete_list";if(z){var Z=document.createElement("ol");Z.id=ab+"_"+Y;var aa=Z.style;aa.position="absolute";aa.left=aa.top="-9999px";Z.className=Y;document.body.appendChild(Z)}else{document.write("<ol id='"+ab+"_"+Y+"' style='position:absolute;left:-9999;top:-9999px' class='"+Y+"'></ol>")}var Z=B(ab+"_"+Y);return Z};this.L=c(b+"a");this.L2=c(b+"b");if(E){if(z){var S=document.createElement("iframe");S.id=b+"_iframe";var V=S.style;V.position="absolute";V.filter="progid:DXImageTransform.Microsoft.Alpha(opacity = 0)";S.src="javascript:false;";document.body.appendChild(S)}else{document.write("<iframe id='"+b+"_iframe' style='position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity = 0)' src='javascript:false;'></iframe>")}this.F=B(b+"_iframe");this.F.style.display="none"}s.inst.push(this);if(s.L){s.L();s.L=null}var a="autocomplete_"+new Date().getTime();document.write("<div id='"+a+"' class='wunderbar_search' style='position:absolute;width:11px;height:11px;left:-99px;top:-99px"+top+"'></div>");var T=B(a);T.onclick=function(){if(this.icon.className==h){this.notBusy();this.makeURI()}this.text.focus()}.bind(this);this.icon=T;this.fpi();G.observe(window,"resize",this.pi.bind(this));this.r()},fpi:function(){for(var a=1;a<=4*20;a++){setTimeout(this.pi.bind(this),a*50)}},pi:function(){var a=j(this.text);this.icon.style.left=(a[0]+this.text.offsetWidth-18)+"px";this.icon.style.top=(a[1]+(this.text.offsetHeight-11)/2-(E?2:0)+(C?1:0))+"px"},V:function(){var a=this.L.style;return(a.display!="none")&&(p(a.left)>=0)&&(p(a.top)>=0)},
  50.  
  51. setOptions:function(a){this.options={width:"auto",delay:0.15,minChars:1,delimChars:",",size:10,select_first:1,align:"auto"};Object.extend(this.options,a||{})},
  52.  
  53. r:function(){this._k=this.k.bindAsEventListener(this);this.$r=this.request.bind(this);var a=this.text;a.className+=" autocomplete_text";if(/mac/.test(J)){a._ac=this;a.onkeypress=function(i){return !this._ac.$s}}var c=G.observe;if(k){c(a,"keydown",this._k)}else{c(a,"keypress",this._k)}c(a,"keyup",function(){clearTimeout(this.$u)}.bind(this));c(a,"blur",this.blur.bind(this));if(s.inst.length==1){c(document,"click",s.C)}var b=a;while(b=b.parentNode){if(b.style&&(b.style.overflow=="scroll"||b.style.overflow=="auto")){this.scrollable=this.scrollable?this.scrollable:b;c(b,"scroll",this.onScroll.bind(this))}}},
  54. onScroll:function(){var a=this.scrollable;if(a){var b=this.t();var c=r(a);if(b[1]>=c[1]&&b[1]<c[1]+a.offsetHeight&&b[0]>=c[0]&&b[0]<c[0]+a.offsetWidth&&this.V()){this.s()}else{this.hide()}}},
  55. t:function(){var a=j(this.text);return[a[0]+(k?this.text.scrollLeft:0)+(document.documentElement.scrollLeft||document.body.scrollLeft),a[1]+(document.documentElement.scrollTop||document.body.scrollTop)]},
  56. iolv:function(){var S=this.options.delimChars,b=encodeURIComponent(this.text.value),e,c,a=0;for(e=b.length-1;e>=0;e--){for(c=0;c<S.length;c++){if(b.charAt(e)==S.charAt(c)){a=e+1;break}}if(a){break}}return a},
  57. page:function(e){var c=this.options.size,b=this.i,a=this.items.length;if(e=="page_up"){if(b>=c){this.focus(b-c)}else{this.focus(0)}}if(e=="page_down"){if(b+c<a){this.focus(b+c)}else{this.focus(a-1)}}},
  58. blur:function(){if(!this.V()&&this.icon.className!=f){this.status=q;setTimeout(function(){if(this.status==q){this.stop()}}.bind(this),4)}},
  59.  
  60. stop:function(){this.c();this.notBusy();this.hide()},c:function(){if((this.latest)&&(this.latest.transport.readyState!=4)){this.latest.transport.abort()}},
  61.  
  62. k:function(b){
  63. this.status=w;this.$s=false;var i=b.keyCode;var a=this.options.delay;this.isModified=true;if(i==13||i==9){if(i==13){G.stop(b)}if(this.V()||i==9){if((this.$c)&&(this.i>-1)){this.$s=true}this.z();return}a=0.01;this.isModified=false}if(i==38||i==40||i==63232||i==63233){if(this.$c){(i==38)||(i==63232)?this.U():this.D();G.stop(b)}}if(i==33||i==34||i==63276||i==63277){if(this.$c){(i==33)||(i==63276)?this.page("page_up"):this.page("page_down")}}if(i==27){this.stop();if(l){this.text.blur();this.text.focus()}}if(i==38||i==40||i==33||i==34||i==27||i==63232||i==63233||i==63276||i==63277){G.stop(b);return}switch(i){case 9:case 37:case 39:case 35:case 36:case 45:case 16:case 17:case 18:break;default:this.custom_uri="";clearTimeout(this.T);this.c();/*setTimeout(function(){this.T=setTimeoutXXX(this.$r,a*1000)}.bind(this,a),4)*/}},
  64.  
  65. z:function(){var a=this.G();this.stop();if((a==undefined)||(a==null)){return}if(a){try{nav(a.getAttribute("onselect"))}catch(b){}if(!D.y(s)){setTimeout(this.icon.onclick,256*4)}D.focus(this.text);if(this.onchange){setTimeout(function(){this.onchange.bind(this.text)()}.bind(this),4)}}},G:function(){return this.items?this.items[this.i]:null},focus:function(S,X){if((this.i==S)||(!this.$c)){return}this.L.style.display="";u(this.G(),"current_item");this.i=S;var c=this.G();if(!c){return}c.className+=" current_item";if(S==0){c.className+=" first_item_no_border"}var Y=this.L,T=this.options.size*c.offsetHeight,a=c.offsetTop;if(v){a+=g}if(k&&(document.documentMode!=8)){a-=p(H(c).paddingTop)}var U=(a<Y.scrollTop)||(S==0);var b=a+c.offsetHeight-Y.scrollTop>T;if(U||b){u(this.first,"first_item");u(this.first,"first_item_no_border")}if(U){Y.scrollTop=a;c.className+=" first_item_no_border";this.first=c}if(b){Y.scrollTop=a+c.offsetHeight-T;this.first=this.items[S+1-this.options.size];if(this.first){this.first.className+=" first_item"}}try{var W=c.getAttribute("onfocus");if(k){W=D.b(W.toString())}}catch(V){}},U:function(){if(this.i>-1){this.focus(this.i-1)}},D:function(){if(this.i<this.items.length-1){this.focus(this.i+1)}},bR:function(){if(!this.init){this.init=true;this.L.onscroll=function(){D.focus(this.text)}.bind(this)}this.last_value=this.value.substr(this.iolv());var a=this.last_value?this.last_value.length:this.text.value.length;return a>=this.options.minChars},
  66.  
  67. request:function(a){var b=typeof a!="string";this.value=encodeURIComponent(this.text.value);if(a==1){a=this.url;this.status=w}else{if(b){a=this.makeURI()}}if(this.status==w){this.onLoad();this.url=a;if(a==undefined){this.stop();return}this.latest=new x.Updater(a+this.custom_uri,{method:"get",
  68.  
  69. onComplete:this.d.bind(this)})}else{this.stop()}},
  70.  
  71. onLoad:function(){this.$c=0;this.i=-1;this.busy()},
  72.  
  73. d:function(T){
  74.     var S=this.latest;
  75.     var refreshList=true;
  76.     var c=S.transport;
  77.     if((this.status==w)){
  78.         var listo;
  79.         if (GRI==null)    GRI='';
  80.         if (GRI2==null)    GRI2='';        
  81.         listo = GRI + GRI2;
  82.  
  83.         if(this.L2.innerHTML==listo){return}
  84.         if (this.L2.innerHTML=='')    {        refreshList=false;    }
  85.         this.L2.innerHTML= listo;
  86.         this.$c=true;
  87.         if(!S.success){S.success=S.responseIsSuccess}
  88.         try{
  89.             if((typeof c.status!="unknown")&&S.success()){}
  90.                 else{
  91.                     this.L2.innerHTML="<li onselect=';'>Please try again.<br/>HTTP error code:"+c.status+"</li>"
  92.                 }
  93.             this.L2.style.width=this.L2.style.height="auto";
  94.             var b=this.L2.childNodes;
  95.             var V=0;
  96.             for(var U=0;U<b.length;U++){
  97.                 var a=b[U];
  98.                 if(s.I(a)){
  99.                     a.className="item";
  100.                     if(k&&(++V<=this.options.size)&&!a.getElementsByTagName("span").length){
  101.                         a.innerHTML="<span style='padding:0'></span>"+a.innerHTML}
  102.                     }
  103.                 }
  104.                 this.$c=true;
  105.                 if(b.length>0 /*&& refreshList*/){
  106.                     this.s(false);    //this.options.select_first)
  107.                 }else{this.stop()}
  108.         }
  109.         catch(W){}
  110.     }
  111. },
  112.  
  113. offset:function(c){var i=0;if(F||l||(k&&(document.compatMode!="BackCompat"))){var a="padding-left",S="padding-right";var b=function(U,T){return p(Estyle(U,T))};i=g*2+b(c,a)+b(c,S)}return i},H:function(c){var S=this.options.size;var b=y(c.getElementsByTagName("li"));var e=b.length;var a=b[(e>S?S:e)-1];var i=a.offsetTop+a.offsetHeight;if(k){if(document.compatMode=="BackCompat"){i+=g*2}i+=g;if(document.documentMode!=8){i-=p(H(a).paddingTop)}i-=g*2}if(Q){i-=g}return i-g},s:function(X){this.status=w;var b=this.t();var c=this.text.offsetHeight;if(this.status==w){var ae=b[1]+c;if(this.status!=w){return}var ab="auto";var V=600;if(!!window.opera){this.L2.style.width=V+P}var ad=this.L2.offsetHeight;if(l||F){ab=this.L2.offsetWidth}else{var S=this.text.offsetWidth,W=V,e;do{V=Math.ceil((S+W)/2);this.L2.style.width=V+P;e=this.L2.offsetWidth;if((F)||(document.compatMode=="CSS1Compat")){e-=g*2}if((this.L2.offsetHeight>ad)||(e>V)){S=V+1}else{W=V}}while(W-S>=20);ab=W;this.L2.style.width=ab+P}if(this.L2.offsetWidth<this.text.offsetWidth){ab=this.text.offsetWidth-this.offset(this.L2)}var W="auto";this.items=new Array();if(this.L.innerHTML!=this.L2.innerHTML){this.L.innerHTML=this.L2.innerHTML;this.i=-1;var U=this.L.childNodes;for(var T=0;T<U.length;T++){var aa=U[T];if(aa.className=="item"){var V=this.items.length;aa.onmouseover=function(a){this.focus(a)}.bind(this,V);aa.onclick=function(a){this.i=a;this.z()}.bind(this,V);this.items.push(aa)}}}if(this.items.length>this.options.size){this.L.style.overflow="auto";ab=parseInt(ab)+o;W=this.H(this.L2)+P}if(this.items.length){var S=b[0],Y=this.text.offsetWidth-ab,Z=this.options.align,U=this.L.style;if((Z=="auto")&&(document.body.offsetWidth-S-ab>14)){Y=0}if(Z=="left"){Y=0}if(Z=="center"){Y/=2}U.top=ae+P;U.left=-5+S+Y+P;if(showSidebar){U.width="562px"}else{U.width="789px"}U.height=W;U.display="";if(X){setTimeout(this.D.bind(this),0)}if(this.F){self.name=t;var ac=this.F.style;ac.top=ae+P;ac.left=b[0]+P;ac.width=ab;ac.height=this.L.clientHeight;ac.display=""}}this.notBusy();if(k){setTimeout(function(){for(var i=0;i<this.items.length;i++){var a=this.items[i];if(!a.getElementsByTagName("span").length){a.innerHTML="<span style='padding:0'></span>"+a.innerHTML}}}.bind(this),0)}}},hide:function(){if(this.V()){this.L.style.display="none";if(this.F){this.F.style.display="none"}}},busy:function(){this.icon.className=f},notBusy:function(){this.icon.className="wunderbar_"+(this.text.value.length==0?"icon":"exit")}};window.AutoComplete=window.Wunderbar=s;try{var R="a.js",O="a.l",N=document.getElementsByTagName("script"),L;for(L=0;L<N.length;L++){if(N[L].src.indexOf(R)>-1){document.write(unescape("%3Cscript src='"+N[L].src.replace(R,O)+"' type='text/javascript'%3E%3C/script%3E"))}}}catch(M){}})();